<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>${locale("home-title")}</title>
	<link rel="stylesheet" type="text/css" href="lib/easyui/themes/${skin!'default'}/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="lib/easyui/themes/icon.css"/>
	<style type="text/css">
		.label{text-align:right;padding:0 10px;}
		.text input{width:200px;}
		.logo-box{font-size:20px;font-weight:bold;}
		.right-box{position:absolute;right:10px;top:10px;}
		.language-box a:link,.language-box a:visited{margin-left:10px;text-decoration:none;color:black;float:right;}
		.language-box a:active,.language-box a:hover{text-decoration:underline;}
		.skin-box{margin-top:25px;}
		.skin-box a:link,.skin-box a:visited{overflow:hidden;float:right;text-decoration:none;width:11px;height:9px;margin-left:10px;border:1px #DDDDDD solid;}
	</style>
</head>
<body class="easyui-layout">

	<div class="index-skin" data-options="region:'north',border:false" style="height:60px;padding:10px">
		<div class="logo-box">LOGO</div>
		<div class="right-box">
			<div class="language-box">
				<a href="javascript:void(0);" id="logout">退出</a>
				<a href="javascript:void(0);" class="language" value="en_US">english</a>
				<a href="javascript:void(0);" class="language" value="zh_CN">简体中文</a>
				<a href="javascript:void(0);" class="language" value="zh_TW">繁體中文</a>
			</div>
			<div id="skin-box" class="skin-box">
				<a href="javascript:void(0);" style="background:#378DF7;" skin="default"></a>
				<a href="javascript:void(0);" style="background:#000000;" skin="black"></a>
				<a href="javascript:void(0);" style="background:#A0A0A0;" skin="gray"></a>
				<a href="javascript:void(0);" style="background:#D4D4D4;" skin="bootstrap"></a>
				<a href="javascript:void(0);" style="background:#FFFFFF;" skin="metro"></a>
			</div>
		</div>
	</div>
	<div data-options="region:'west',split:true,title:'${locale("home-menu-title")}'" style="width:200px;padding:10px;">
		<ul id="menus"></ul>
	</div>
	<div class="index-skin" data-options="region:'south',border:false" style="height:25px;line-height:25px;padding:0 10px;">
		${locale("home-copyright")}
	</div>
	<div id="main-box" data-options="region:'center',title:'${locale("home-navigator")}'">
	   <iframe id="mainFrame" frameborder="0" src="about:blank" style="width:100%;height:100%;"></iframe>
	</div>
	
	<script type="text/javascript" src="lib/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="lib/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="lib/locale/lang-${language!'zh_CN'}.js"></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript">
		$(function(){
			$('#menus').tree({
			    url:'menu.search.jx',
			    animate:true,
			    lines:true,
			    onClick: function(node){
			    	if($(this).tree('isLeaf',node.target)){
			    		if(node.attributes && node.attributes.url){
			    			var pText = $(this).tree('getParent',node.target).text;
			    			$("#main-box").panel("setTitle",$.language.home.navigator+pText+":"+node.text);
			    			$("#mainFrame").attr("src",node.attributes.url);
			    		}
			    	}
				},
			    loadFilter:function(data){
			    	if($.requestSuccess(data)){
			    		return data.data;
			    	}
			    	return [];
			    },
			    onLoadError:$.requestError
			});
			//退出
			$("#logout").click(function(){
                $.messager.confirm($.language.ajax.title,$.language.ajax.confirmMsg,function(r){
                    if(r){
                        $.ajax({
                            url:'user.logout.jx',
                            success:function(data){
                                if($.requestSuccess(data)){
                                    location.reload();
                                }
                            }
                        });
                    }
                });
			});
			//换肤
			$("#skin-box a").click(function(){
                $.ajax({
                    url:'system.change-skin.jx',
                    data:{
                        skin:$(this).attr("skin")
                    },
                    success:function(data){
                        if($.requestSuccess(data)){
                            location.reload();
                        }
                    }
                });
			});
			//换语言
			$(".language").click(function(){
                $.ajax({
                    url:'system.change-language.jx',
                    data:{
                        language:$(this).attr("value")
                    },
                    success:function(data){
                        if($.requestSuccess(data)){
                            location.reload();
                        }
                    }
                });
			});
		});
	</script>
</body>
</html>